Find and Replace Pane
The Script Editor's Find and Replace Pane, which is hidden by default, allows you to find and replace words or phrases in your code.
To find a word or phrase in your code
- Open the Find and Replace Pane by using the keyboard shortcut CTRL+F or by clicking View from the main menu of the Script Editor and selecting Find.
- Type the text you want to find under Find what in the pane.
- Select where you want to look for the text by clicking on the drop-down menu under Look in. Select to search the Current Document (script file), All Open Documents (script files), or the Current Project (all script files in the project).
- Optional: Under Find Options, choose to Match Case, Match whole word, or Search up (search from the bottom of the document to the top). You can also select the Use option and choose Regular expressions or Wildcards from the drop down menu. If you select to use regular expressions, the pattern matching button next to the Find what text box will display a list of regular expressions you can use in your search term. If you select to use wildcards, the same button will display a list of wildcards you can use in your search term.
- Click Find Next to go to the next instance of your search term in the code or Find All to find all instances of your search term in the code. The search term will be highlighted in the code.
- Optional: Click Bookmark All to bookmark every line that the search term appears in.
To replace a word or phrase in your code
- Open the Find and Replace Pane by using the keyboard shortcut CTRL+F or by clicking View from the main menu of the Script Editor and selecting Find.
- Click Replace at the top of the pane.
- Type the text you want to find under Find what in the pane.
- Under Replace with, type the text you want to replace the text under Find What.
- Select where you want to look for the text by clicking on the drop-down menu under Look in. Select to search the Current Document (script file), All Open Documents (script files), or the Current Project (all script files in the project).
- Optional: Under Find Options, choose to Match Case, Match whole word, or Search up (search from the bottom of the document to the top). You can also select the Use option and choose Regular expressions or Wildcards from the drop down menu. If you select to use regular expressions, the pattern matching button next to the Find what text box will display a list of regular expressions you can use in your search term. If you select to use wildcards, the same button will display a list of wildcards you can use in your search term.
- Optional: Under Replace Options, you can select to keep open the files in which you replaced text if you select Replace All below.
- Click Find Next to go to the next instance of your search term in the code. Click Replace to replace that single instance of the search term. Click Replace All to automatically replace all the search terms in your code with the text you typed under Replace with.
- Optional: Click Bookmark All to bookmark every line that the search term appears in.